﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Taxi_taxi.Resources;
using Taxi_taxi.ViewModels;

namespace Taxi_taxi
{
    public partial class MainPage : PhoneApplicationPage
    {
        MenuViewModel MenuVMD;
        public MainPage()
        {
            InitializeComponent();
            this.Loaded += MainPage_Loaded;
        }
        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {           
            MenuVMD = new MenuViewModel();
            lstMenuLeft.ItemsSource = MenuVMD.Menu;
        }

        private void menuGrid_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            Menu _menu = (sender as Grid).DataContext as Menu;
            switch (_menu.ID)
            {
                case 1:
                    NavigationService.Navigate(new Uri("/View/TaxiPage.xaml", UriKind.Relative));
                    break;             
                case 6:
                    NavigationService.Navigate(new Uri("/View/ThiBangLai.xaml", UriKind.Relative));
                    break;
              
                default:                  
                    break;
            }
        }
    }
}